﻿using D.Domain.SeedWork.EventUtil;

namespace D.Domain.SeedWork.EventStorageUtil
{
    /// <summary>
    /// 事件源存储
    /// </summary>
    public interface IEventStorage
    {
        /// <summary>
        /// 获取事件源
        /// </summary>
        /// <param name="aggregateId"></param>
        /// <returns></returns>
        IEnumerable<DomainEvent> GetEvents(Guid aggregateId);

        /// <summary>
        /// 保存事件源
        /// </summary>
        /// <param name="aggregate"></param>
        void Save(AggregateRoot aggregate);

        ///// <summary>
        ///// 获取快照
        ///// </summary>
        ///// <typeparam name="T"></typeparam>
        ///// <param name="aggregateId"></param>
        ///// <returns></returns>
        //T GetSnapshot<T>(Guid aggregateId) where T : BaseSnapshot;

        ///// <summary>
        ///// 保存快照
        ///// </summary>
        ///// <param name="snapshot"></param>
        //void SaveSnapshot(ISnapshot snapshot);
    }
}
